home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 146
/
(Vol 146) Jan 07 2012.iso
/
Games
/
scuba.swf
/
scripts
/
frame_18
/
PlaceObject2_111_78
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2012-01-07
|
1KB
|
39 lines
onClipEvent(enterFrame){
if(status == "active" && this._x >= _root.RIGHT_BOUND)
{
if(_root.coral.hitTest(this._x,this._y,true) == true)
{
vSideOfImpact = "undetermined";
vPixelCounter = Number(1);
while(vSideOfImpact == "undetermined")
{
if(_root.coral.hitTest(this._x,Number(this._y + Number(vPixelCounter)),true) == false && Number(this._y + Number(vPixelCounter)) < _root.BOTTOM_BOUND)
{
vSideOfImpact = "top";
vPixelOffset = vPixelCounter + Number(this._height);
}
else if(_root.coral.hitTest(this._x,Number(this._y - Number(vPixelCounter)),true) == false && _root.TOP_BOUND < Number(this._y - Number(vPixelCounter)))
{
vSideOfImpact = "bottom";
vPixelOffset = vPixelCounter + Number(this._height);
}
vPixelCounter++;
}
if(vSideOfImpact == "top")
{
setProperty(this, _Y, Number(this._y + Number(vPixelOffset)));
}
else if(vSideOfImpact == "bottom")
{
setProperty(this, _Y, Number(this._y - Number(vPixelOffset)));
}
}
}
else if(status == "active" && this._x < _root.RIGHT_BOUND && _root.recruit.diver.hitTest(this._x,this._y,false) == true)
{
status = "neutralized";
this.gotoAndPlay("neutralized");
_root.fnScorePoints();
}
}